package com.yanjiali.mappers;

import com.yanjiali.entity.Article;
import com.yanjiali.model.req.ArticleUpdateReq;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Package: com.yanjiali.mappers
 * @Author: yanjiali
 * @Created: 2025/4/16 19:31
 */
@Mapper(componentModel = "spring")
public interface ArticleUpdateReqMapper {

    ArticleUpdateReqMapper INSTANCE = Mappers.getMapper(ArticleUpdateReqMapper.class);

    /**
     * req ---> entity
     * @param articleUpdateReq
     * @return
     */
    Article req2Entity(ArticleUpdateReq articleUpdateReq);

    /**
     * 批量 req --> entity
     * @param articleUpdateReqs
     * @return
     */
    List<Article> reqALL2Entity(List<ArticleUpdateReq> articleUpdateReqs);
}
